// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-typeof-operator-runtime-semantics-evaluation
description: typeof Number literal
info: |
  The typeof Operator

  Runtime Semantics: Evaluation

    ...
    Return a String according to Table 35.

  #table-35

  Number "number"

---*/

function Test() {
    assert.sameValue(
      typeof 1,
      "number",
      'typeof 1 === "number"'
    );

    assert.sameValue(
      typeof NaN,
      "number",
      'typeof NaN === "number"'
    );

    assert.sameValue(
      typeof Infinity,
      "number",
      'typeof Infinity === "number"'
    );

    assert.sameValue(
      typeof -Infinity,
      "number",
      'typeof -Infinity === "number"'
    );

    assert.sameValue(
      typeof Math.PI,
      "number",
      'typeof Math.PI === "number"'
    );
}

// preheat
const NUMBER_OF_PREHEAT = 1;
for (let i = 0; i < NUMBER_OF_PREHEAT; i++) {
    Test();
}

ArkTools.jitCompileAsync(Test);
assert.sameValue(ArkTools.waitJitCompileFinish(Test), true, '[JIT] JIT disabled.');

// test
const NUMBER_OF_TEST = 1; // or 2
for (let i = 0; i < NUMBER_OF_TEST; i++) {
    Test();
}
